<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>文本淡化效果</title>
  <style>
    /* .fade-enter-active,
    .fade-leave-active {
      transition: opacity .5s;
    } */

   
    .fade-enter-active {
      transition: opacity .5s;
    }

    .fade-leave-active {
      transition: opacity 2.5s;
    }

    .fade-enter,
    .fade-leave-to

    /* .fade-leave-active below version 2.1.8 */
      {
      opacity: 0;
    }
  </style>
  <script src="../js/vue.js"></script>
</head>

<body>
  <!-- 创建一个 div id 为 demo  挂载点 -->
  <div id="demo">
    <button v-on:click="show = !show">Toggle 切换</button>
    <transition name="fade">
      <p v-if="show">Hello World</p>
    </transition>
    <transition name="fade">
      <p>Hello Kitty</p>
    </transition>
  </div>
  </div>

  <!-- 使用javascript 脚本 -->
  <script type="text/javascript">
    new Vue({
      el: "#demo",
      data: {
        show: true,
      },
    });
  </script>
</body>

</html>